<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of StatusTransacaoDAO
 *
 * @author Albuquerque
 */
class StatusTransacaoDAO {
     var $conect;

    function __construct(){
	$this->conect = FactoryConnection::getConexao();
    }

    public function salvar($statusTransacao){
        $statusTransacao= new StatusTransacao();
        $query = "SELECT * FROM ceape_status_transacao
                WHERE id_transacao ='".$statusTransacao->getIdTransacao()."' AND status='".$statusTransacao->getStatus()."'";

        $resultado = $this->conect->query($query);
        if($resultado!=NULL){
		if($resultado->rowCount()){
                      $query="INSERT INTO ceape_status_transacao(status,id_transacao)
                          VALUES('".$statusTransacao->getStatus()."','".$statusTransacao->getIdTransacao()."')";
                      return $this->conect->exec($query);
                }
        }
	return false;
    }

    
}
?>